<?php
/* @var $this ProductController */
/* @var $model Product */

$this->breadcrumbs=array(
	'综合控制台'=>array($this->pre_module_url.'/index/index'),
	'产品管理'=>array($this->pre_module_url.'/productSale/admin'),
	'出售中的产品'=>array($this->pre_module_url.'/productSale/admin'),
);
//行业分类
$category = Category::model()->findByPk($model->catgory_id);
?>

<div class="pro_filter c_f">
		<?php $form=$this->beginWidget('CActiveForm', array(
			'action'=>Yii::app()->createUrl($this->route),
			'method'=>'get',
		)); ?>
			<label>类目：</label>
			<span id="catagory" >
				<select name="Product[cateid1]" class="level_1 s_ipt w_120" id="dataProductIndustryId1" ></select>
				<select name="Product[cateid2]" class="level_2 s_ipt w_120" id="dataProductIndustryId2"></select>
				<select name="Product[cateid3]" class="level_3 s_ipt w_120" id="dataProductIndustryId3" ></select>
			</span>
			<?php echo $form->dropDownList($model,'search_type',Product::model()->getSearchType(),array('class'=>'s_ipt w_120'))?>
			<?php echo CHtml::textField('Product[search_content]',empty($model->search_content)?'请输入关键字':$model->search_content,array('class'=>'t_ipt w_170','onfocus'=>"if (value =='请输入关键字'){value =''}",'onblur'=>"if (value ==''){value='请输入关键字'}"))?>
			<?php echo CHtml::submitButton(Yii::t('adm','Search'),array('class'=>'mem_bgx mem_btn01')); ?>
		<?php $this->endWidget(); ?>
</div>
        	
<table class="list_table list_table2" width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<th width="" class="pl15">宝贝信息</th>
		<th width="17%">店铺名称</th>
		<th width="12%">价格</th>
		<th width="12%">库存</th>
		<th width="12%">发布时间</th> 
		<th width="12%">操作</th>                                                    
	</tr>
</table>


<?php 
$this->widget('zii.widgets.CListView', array(
	'dataProvider'=>$model->search(15),
	'itemView'=>'../product/_view',	
	'emptyText'=>'暂时没有数据',
	'selectAll'=>array('ids[]','id[]'),
	'itemsTagName'=>'table',
	'itemsOptions'=>array('class'=>'list_table list_table2','width'=>'100%','cellpadding'=>0,'cellspacing'=>0),
	'artLink'=>array(
		//下架
		array(Yii::t('cmp','downshelf'),$this->pre_module_url.'/product/downShelf','确认下架选中产品！'),
		//审核
	//	array(Yii::t('adm','Check Pass'),$this->pre_module_url.'/product/checkPass','确认要设选中产品为审核通过！'),
	),
	));
?>

<script type="text/javascript" src="/js/multi_select.js"></script>
<script type="text/javascript">
$.getJSON('/cache/GetCategory',function(json){
	var options	= {data	: json};
	var loc = new multi_select(options);
	loc.bind('#catagory .level_1','<?php if(!empty($category)) echo ($category->zca_topid>0)?$category->zca_topid:(($category->zca_parentid>0)?$category->zca_parentid:$category->zca_id)?>');
	loc.bind('#catagory .level_2','<?php if(!empty($category)) echo ($category->zca_topid>0)?$category->zca_parentid:(($category->zca_parentid>0)?$category->zca_id:'')?>');
	loc.bind('#catagory .level_3','<?php if(!empty($category)) echo ($category->zca_topid>0)?$category->zca_id:''?>');
});
</script>